package org.academic.texteditor.gui.component.listener;

import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JComponent;

import org.academic.texteditor.gui.component.ComponentFactory;
import org.academic.texteditor.gui.style.StyleType;

public class BackgroundFocusListener implements FocusListener {

	public BackgroundFocusListener() {

	}
	
	public void focusGained(FocusEvent event) {
		JComponent component = (JComponent) event.getComponent();
		ComponentFactory.applyStyle(component, StyleType.SELECTED_FIELD);
	}

	public void focusLost(FocusEvent event) {
		JComponent component = (JComponent) event.getComponent();
		ComponentFactory.applyStyle(component, StyleType.COMMON_FIELD);
	}

}
